package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InvoiceFlowMapper;
import com.ruoyi.system.domain.InvoiceFlow;
import com.ruoyi.system.service.IInvoiceFlowService;

/**
 * 供应商流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-18
 */
@Service
public class InvoiceFlowServiceImpl implements IInvoiceFlowService 
{
    @Autowired
    private InvoiceFlowMapper invoiceFlowMapper;

    /**
     * 查询供应商流水
     * 
     * @param id 供应商流水主键
     * @return 供应商流水
     */
    @Override
    public InvoiceFlow selectInvoiceFlowById(Long id)
    {
        return invoiceFlowMapper.selectInvoiceFlowById(id);
    }

    /**
     * 查询供应商流水列表
     * 
     * @param invoiceFlow 供应商流水
     * @return 供应商流水
     */
    @Override
    public List<InvoiceFlow> selectInvoiceFlowList(InvoiceFlow invoiceFlow)
    {
        return invoiceFlowMapper.selectInvoiceFlowList(invoiceFlow);
    }

    /**
     * 新增供应商流水
     * 
     * @param invoiceFlow 供应商流水
     * @return 结果
     */
    @Override
    public int insertInvoiceFlow(InvoiceFlow invoiceFlow)
    {
        return invoiceFlowMapper.insertInvoiceFlow(invoiceFlow);
    }

    /**
     * 修改供应商流水
     * 
     * @param invoiceFlow 供应商流水
     * @return 结果
     */
    @Override
    public int updateInvoiceFlow(InvoiceFlow invoiceFlow)
    {
        return invoiceFlowMapper.updateInvoiceFlow(invoiceFlow);
    }

    /**
     * 批量删除供应商流水
     * 
     * @param ids 需要删除的供应商流水主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceFlowByIds(Long[] ids)
    {
        return invoiceFlowMapper.deleteInvoiceFlowByIds(ids);
    }

    /**
     * 删除供应商流水信息
     * 
     * @param id 供应商流水主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceFlowById(Long id)
    {
        return invoiceFlowMapper.deleteInvoiceFlowById(id);
    }

    @Override
    public List<Map<String, Object>> listInvoiceMoney(String provide, String startTime) {
        return invoiceFlowMapper.listInvoiceMoney(provide, startTime);
    }

    @Override
    public List<Map<String, Object>> listProvideMoney(String provide, String startTime) {
        return invoiceFlowMapper.listProvideMoney(provide, startTime);
    }

    @Override
    public InvoiceFlow listLastInvoiceFlow(String provide) {
        return invoiceFlowMapper.listLastInvoiceFlow(provide);
    }
}
